namespace Mbl.ParameterizedTest
{
    public class TestCaseAssertionResult
    {
        public bool Holds { get; }

        protected TestCaseAssertionResult(bool assertionHolds)
        {
            Holds = assertionHolds;
        }

        public static readonly TestCaseAssertionResult Success = new TestCaseAssertionResult(true);

        public string ErrorMessage { get; private set; } = string.Empty;

        public JustifiedTestCase TestCase { get; private set; }

        public string Justification => TestCase.Justification;

        public static TestCaseAssertionResult Error(JustifiedTestCase testCase, string errorMessage)
        {
            return new TestCaseAssertionResult(false)
            {
                ErrorMessage = errorMessage,
                TestCase = testCase
            };
        }
    }
}